$OpenBSD: patch-lib_make-imglib_c,v 1.2 2017/05/01 20:48:55 espie Exp $
Index: lib/make-imglib.c
--- lib/make-imglib.c.orig
+++ lib/make-imglib.c
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -58,7 +59,7 @@ scan_image_directory ()
     perror("The error was");
     exit(1);
   }
-  while (de = readdir(dir)) {
+  while ((de = readdir(dir))) {
     FILE *f;
     char *dot;
     png_structp png_ptr;
@@ -86,7 +87,7 @@ scan_image_directory ()
     png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, 0, 0, 0);
     info_ptr = png_create_info_struct (png_ptr);
 
-    if (setjmp (png_ptr->jmpbuf)) {
+    if (setjmp (png_jmpbuf(png_ptr))) {
       fclose (f);
       continue;
     }
@@ -202,7 +203,7 @@ tokenize(char *string)
   char *rv;
   if (string) {
     next = string;
-    return;
+    return 0;
   }
   while (*next && !isgraph(*next)) next++;
   if (!*next) return 0;
@@ -257,7 +258,7 @@ main(int argc, char **argv)
     case 'd':
       depfile = fopen(optarg, "w");
       if (!depfile) {
-	fprintf(stderr, "Unable to open dependency file %s for writing\n", depfile);
+	fprintf(stderr, "Unable to open dependency file %s for writing\n", optarg);
 	perror("The error was");
 	exit(1);
       }
